﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QuanLyThongTinNhanKhau.model.DAO
{
    class LoginDAO
    {
        SQLServiceDAO service = new SQLServiceDAO();


        internal bool btnLoginClick(string tenDangNhap, string matKhau)
        {
            String sql = "select TOP(1) * from NGUOIDUNG where TenDangNhap = '" + tenDangNhap + "' and MatKhau = '" + matKhau + "' and TinhTrang = 'Enable'";
            DataTable dt = service.getDataTable(sql);

            if (dt.Rows.Count != 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}
